﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Simple.Repository.Models.Market;

namespace Simple.Services.System.Market.Models
{
    /// <summary>
    /// 商品维护
    /// </summary>
    public class CommodityCreateOrUpdateModel : ModelBase
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public Guid? Id { get; set; } = null;
        /// <summary>
        /// 商品名称/标题
        /// </summary>
        public string Title { get; set; } = "";

        /// <summary>
        /// 是否上架显示
        /// </summary>
        public bool IsShow { get; set; } = false;

        /// <summary>
        /// 库存
        /// </summary>
        public int StockCount { get; set; }

        /// <summary>
        /// 价值积分
        /// </summary>
        public int Integral { get; set; }

        /// <summary>
        /// 内容或描述
        /// </summary>
        public string Content { get; set; } = "";

        /// <summary>
        /// 分类Id
        /// </summary>
        public Guid? CategoryId { get; set; }

        /// <summary>
        /// 图片集合
        /// </summary>
        public List<IFormFile>? ImageList { get; set; } = null;

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<Commodity, CommodityCreateOrUpdateModel>();

            profile.CreateMap<CommodityCreateOrUpdateModel, Commodity>();

        }
    }
}
